package drinkkiosk.buttons;

import serialtool.SerialTool;
import drinkkiosk.drinks.SpecialDrink;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import networktool.KioskClient;

/**ExitButton is a JButton on the manager card
 * that exits the program when pressed
 * @author Charles Ritchea
 */
public class ExitButton extends JButton implements ActionListener{
	/**ExitButton() This constructor sets the button Icon to the universal
	 * Shut-down image, and attaches the ActionListener
	 */
	public ExitButton() {
		super();
		setContentAreaFilled(false);
		setIcon(new ImageIcon(getClass().getResource("/drinkkiosk/shutdown-button-th.png")));
		addActionListener(this);
	}
	/**Will exit the program when this button is pressed.
	 * @param e ActionEvent the event when an ExitButton is pressed.
	 */
	@Override
	public void actionPerformed(ActionEvent e) {
                try{
		SerialTool serialTool2 = new SerialTool();

		serialTool2.getResult("led0");
                                }
                catch(java.lang.Throwable t) {
                    
                }
		System.exit(0);
	}
}